package cn.gok.entity;

import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author: chen fan
 * @since: 2022/11/8 11:47
 * @description:
 */
public class User {

    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp="\\w{2,20}",message = "用户名由字母数字下划线组，且长度在2~20位之间")
    private String userName;

    private String password;

    @Range(min=18,max=65,message = "年龄范围在18~65岁之间")
    private Integer age;

    @Email(message = "邮箱格式不正确")
    private String email;

    @Pattern(regexp="1(3|6|7|5|9)[0-9]{9}",message = "手机号格式不正确")
    private String phoneNo;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhoneNo() {
        return phoneNo;
    }

    public void setPhoneNo(String phoneNo) {
        this.phoneNo = phoneNo;
    }
}
